import api from 'Plugins/api'
import consts from 'Service/store/const'

export default {
    async getDetailPlayList({ commit }, param){
        const result = await api['playlist/detail'](param);

        commit(consts.SETPLAYLIST, result);
    },
    async getPlayUrl({ commit }, param){
        const result = await api['playlist/songUrl'](param);
        
        commit(consts.SETPLAYURL, result.data);
    },
    async getPlayLyric({ commit }, param){
        const result = await api['playlist/lyric'](param);
        
        commit(consts.SETPLAYLYRIC, result.lrc);
    },
    async recommendNewSong({ commit },param){
        const result = await api['playlist/songCate'](param);
        commit(consts.SETNEWSONG, result.data)
    },
    async getNewDisk({ commit },param){
        const result = await api['top/album'](param);
        commit(consts.SETDISK, result.data)
    }
}
